﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LiteStep.Currencies
{
	public class CurrencyType<T> : ICurrencyType<T>
		where T : ICurrency
	{
		private static int Index { get; set; }

		public bool Equals(CurrencyType<T> other)
		{
			if ((object)other == null)
			{
				return false;
			}

			return true;
		}

		public override bool Equals(object obj)
		{
			// If parameter is null return false.
			if (obj == null)
			{
				return false;
			}

			// If parameter cannot be cast to Point return false.
			var other = obj as CurrencyType<T>;
			if ((object)other == null)
			{
				return false;
			}

			return true;
		}

		public override int GetHashCode()
		{
			return Index;
		}

		public override string ToString()
		{
			return "Currency type";
		}

		public static bool operator ==(CurrencyType<T> a, CurrencyType<T> b)
		{
			// If both are null, or both are same instance, return true.
			if (object.ReferenceEquals(a, b))
			{
				return true;
			}

			// If one is null, but not both, return false.
			if (((object)a == null) || ((object)b == null))
			{
				return false;
			}

			// Return true if the fields match:
			return true;
		}

		public static bool operator !=(CurrencyType<T> a, CurrencyType<T> b)
		{
			return !(a == b);
		}
	}
}
